package com.yituo.mjworld.mvc.entity.other;

import javax.persistence.*;
import java.util.Date;

/**
 * @author xq
 */
@Entity
@Table(name = "token", schema = "tool", catalog = "")
public class TokenVO {
  private Integer userId;
  private String token;
  private Date createDate;
  private Integer validTime;

  @Id
  @Column(name = "userId")
  public Integer getUserId() {
    return userId;
  }

  public void setUserId(Integer userId) {
    this.userId = userId;
  }

  @Basic
  @Column(name = "token")
  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

  @Basic
  @Column(name = "createDate")
  public Date getCreateDate() {
    return createDate;
  }

  public void setCreateDate(Date createDate) {
    this.createDate = createDate;
  }

  @Basic
  @Column(name = "validTime")
  public Integer getValidTime() {
    return validTime;
  }

  public void setValidTime(Integer validTime) {
    this.validTime = validTime;
  }

  @Override
  public int hashCode() {
    int result = userId;
    result = 31 * result + (token != null ? token.hashCode() : 0);
    result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
    result = 31 * result + (validTime != null ? validTime.hashCode() : 0);
    return result;
  }

  @Override
  public String toString() {
    return "TokenVO{" +
        "userId=" + userId +
        ", token='" + token + '\'' +
        ", createDate=" + createDate +
        ", validTime=" + validTime +
        '}';
  }
}
